package cn.com.yiqi.wsc.util;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 何刚
 * @version V1.0
 * @Title: SeqUtil
 * @Package cn.com.yiqi.wsc.util
 * @Description: TODO
 * Copyright: Copyright (c) 2016
 * Company: 成都壹柒互动科技有限公司
 * @date 2017/3/23
 */
public class SeqUtil {
    private SeqUtil() {
    }

    /**
     * seq 转为数组
     */
    public static List<Integer> seq2List(String seq) {

        if (seq == null) {
            return null;
        }

        String[] arr = seq.split("\\.");

        List<Integer> ids = new ArrayList<>();
        for (int i = 1; i < arr.length; i++) {
            if ("0".equals(arr[i])) {
                //去掉顶级特殊设置
                continue;
            }
            ids.add(Integer.parseInt(arr[i]));
        }

        return ids;

    }
}
